package com.technology.education.ui.student.publish

import androidx.lifecycle.MutableLiveData
import com.huantansheng.easyphotos.models.album.entity.Photo
import com.technology.education.data.model.ExchangeGoodsModel
import com.technology.education.ext.toast
import com.technology.education.network.apiService
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.ext.request
import me.hgj.jetpackmvvm.state.ResultState

class PublishViewModel : BaseViewModel() {
    var selectPhoto = mutableListOf<Photo>()
    var teacherId: String? = null
    var question: String = ""
    val result = MutableLiveData<ResultState<ExchangeGoodsModel>>()
    fun commit(list: List<String>) {
        request({
            apiService.placeTeachOrder(
                hashMapOf("teacherId" to teacherId, "questionImages" to list, "question" to question)
            )
        }, result, isShowDialog = true)
    }

}